package indi.caibo.service_edu.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import indi.caibo.service_edu.entity.EduComment;
import indi.caibo.service_edu.entity.EduCourse;
import com.baomidou.mybatisplus.extension.service.IService;
import indi.caibo.service_edu.entity.vo.course.CourseInfoVo;
import indi.caibo.service_edu.entity.vo.course.CoursePublishVo;
import indi.caibo.service_edu.entity.vo.course.CourseQueryVo;
import indi.caibo.service_edu.entity.vo.course.CourseFrontVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author Bo Cai
 * @since 2021-10-07
 */
public interface EduCourseService extends IService<EduCourse> {
    String saveCourseInfo(CourseInfoVo courseInfoVo);

    CourseInfoVo getCourseInfoFormById(String id);

    void updateCourseInfoById(CourseInfoVo courseInfoVo);

    CoursePublishVo getCoursePublishVoById(String id);

    boolean publishCourseById(String id);

    Map<String, Object> pageQuery(Page<EduCourse> pageParam, CourseQueryVo courseQueryVo);

    boolean removeCourseById(String id);

    List<EduCourse> selectByTeacherId(String id);

    Map<String, Object> pageListFront(Page<EduCourse> pageParam, CourseQueryVo courseQuery);

    /**
     * 获取课程信息
     *
     * @param id
     * @return
     */
    CourseFrontVo selectInfoWebById(String id);

    /**
     * 更新课程浏览数
     *
     * @param id
     */
    void updatePageViewCount(String id);

    List<EduCourse> selectHot8Courses();

    Map<String, Object> collectedPageListFront(Page<EduCourse> pageParam, CourseQueryVo courseQuery, String memberId);

    void addCommentCount(String courseId);

    void subCommentCount(String courseId);
}
